package com.dk.service;

import com.dk.pojo.Car;
import com.dk.service.fallback.CarServiceFeignFallback;
import com.dk.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
                                    //服务降级
@FeignClient(value = "CAR-SERVICE",fallback = CarServiceFeignFallback.class)
public interface CarServiceFeign {

    //查询所有
    @GetMapping("/car")
     Result findCarList();


    //根据id查询
    @GetMapping("/car/{carId}")
    Result findCarList(@PathVariable("carId") Integer carId);

    //根据id删除
    @DeleteMapping("/car/{carId}")
     void deleteCarList(@PathVariable("carId") Integer carId);

    //修改
    @PutMapping("/car")
    Result updateCar(@RequestBody Car car);


    //增加
    @PostMapping("/car")
    Result saveCar(@RequestBody Car car);
}
